import request from '@/utils/request'

// 查询基金Call款列表
export function listFundCallMoney(query) {
  return request({
    url: '/callmoney/fundCallMoney/list',
    method: 'get',
    params: query
  })
}

// 查询基金Call款合计
export function getFundCallMoneySum(query) {
  return request({
    url: '/callmoney/fundCallMoney/getSum',
    method: 'get',
    params: query
  })
}

// 查询基金Call款列表
export function listFundCallMoneyAll(query) {
  return request({
    url: '/callmoney/fundCallMoney/listAll',
    method: 'get',
    params: query
  })
}

// 查询基金Call款详细
export function getFundCallMoney(id) {
  return request({
    url: '/callmoney/fundCallMoney/' + id,
    method: 'get'
  })
}

// 保存基金Call款
export function saveFundCallMoney(data) {
  return request({
    url: '/callmoney/fundCallMoney/save',
    method: 'post',
    data: data
  })
}

// 删除基金Call款
export function delFundCallMoney(id) {
  return request({
    url: '/callmoney/fundCallMoney/' + id,
    method: 'delete'
  })
}

// 导出基金Call款
export function exportFundCallMoney(query) {
  return request({
    url: '/callmoney/fundCallMoney/export',
    method: 'get',
    params: query
  })
}

// 删除基金Call款项目
export function delFundCallMoneyDeal(id) {
  return request({
    url: '/callmoney/fundCallMoney/deal/' + id,
    method: 'delete'
  })
}

// 删除基金Call款明细
export function delFundCallMoneyDetail(id) {
  return request({
    url: '/callmoney/fundCallMoney/detail/' + id,
    method: 'delete'
  })
}

// 新增按钮带出出资人
export function getFundCallMoneyInvest(id) {
  return request({
    url: '/callmoney/fundCallMoney/invest/' + id,
    method: 'get'
  })
}

//   根据项目ID获取项目的投资主体中的金额
export function findDealInvestByDealId(dealId, fundId) {
  return request({
    url: '/callmoney/fundCallMoney/investDealId/' + dealId + '/' + fundId,
    method: 'get'
  })
}

//  首列 点选按钮获取 他的Call款明细
export function getFindCallDetails(id, fundId) {
  return request({
    url: '/callmoney/fundCallMoney/getFindCallDetails/' + id + '/' + fundId,
    method: 'get'
  })
}

// 根据基金Id 获取当前基金的 call期次
export function getFundCallQCByFundId(id) {
  return request({
    url: '/callmoney/fundCallMoney/getFundCallQCByFundId/' + id,
    method: 'get'
  })
}

// 根据出资人Id和期次Id获取该出资人在该其次下的Call款金额
export function getAmountByInvestIdCallQcId(investId, callDetailId) {
  return request({
    url: '/callmoney/fundCallMoney/getAmountByInvestIdCallQcId/' + investId + '/' + callDetailId,
    method: 'get'
  })
}

// // 根据当前基金ID获取基金Call款list页面上所有的Call款金额的总和
export function getCallMoneySumByFundId(id) {
  return request({
    url: '/callmoney/fundCallMoney/getCallMoneySumByFundId/' + id,
    method: 'get'
  })
}

// 新增基金四个问好的数据引入
export function getByFundIdInit(fundId) {
  return request({
    url: '/callmoney/fundCallMoney/getByFundIdInit/' + fundId,
    method: 'get'
  })
}

// 根据期次名称查询是否存在重复
export function removeRepetitionByName(callPeriod, fundId) {
  return request({
    url: '/callmoney/fundCallMoney/removeRepetitionByName/' + callPeriod + '/' + fundId,
    method: 'get'
  })
}

// 获取每个Call款期次缴款总和
export function sumContributionsGroupCallPeriod(data) {
  return request({
    url: '/callmoney/fundCallMoney/sumContributionsGroupCallPeriod',
    method: 'get',
    params: data
  })
}

// 公示公告绑定call款
export function callFundsBoundToTheFund(ficheId, callPeriodId) {
  return request({
    url: '/callmoney/fundCallMoney/callFundsBoundToTheFund/' + ficheId + '/' + callPeriodId,
    method: 'get'
  })
}

// 公示公告绑定基金分配
export function fundFpBoundToTheFund(ficheId, fpId) {
  return request({
    url: '/fp/fundFpMain/fundFpBoundToTheFund/' + ficheId + '/' + fpId,
    method: 'get'
  })
}
